package gov.ccswj.modules.bdbusiness.controller;

import java.util.List;
import java.util.Map;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import gov.ccswj.modules.bdbusiness.entity.AaFcprojectEntity;
import gov.ccswj.modules.bdbusiness.service.AaFcprojectService;
import gov.ccswj.common.utils.PageUtils;
import gov.ccswj.common.utils.Query;
import gov.ccswj.common.utils.R;




/**
 * 
 * 
 * @author KY.Cheng
 * @email ********@gmail.com
 * @date 2018-01-02 15:44:40
 */
@RestController
@RequestMapping("/bdbusiness/aafcproject")
public class AaFcprojectController {
	@Autowired
	private AaFcprojectService aaFcprojectService;
	
	/**
	 * 列表
	 */
	@RequestMapping("/list")
	public R list(@RequestParam Map<String, Object> params){
		//查询列表数据
        Query query = new Query(params);

		List<AaFcprojectEntity> aaFcprojectList = aaFcprojectService.queryList(query);
		int total = aaFcprojectService.queryTotal(query);
		
		PageUtils pageUtil = new PageUtils(aaFcprojectList, total, query.getLimit(), query.getPage());
		
		return R.ok().put("page", pageUtil);
	}
	
	
	/**
	 * 信息
	 */
	@RequestMapping("/info/{id}")
	public R info(@PathVariable("id") Integer id){
		AaFcprojectEntity aaFcproject = aaFcprojectService.queryObject(id);
		
		return R.ok().put("aaFcproject", aaFcproject);
	}
	
}
